/**
 * 在线直播页
 * page在线
 */
import 'package:flutter/material.dart';
import 'package:qgchat/common/global/global.dart';
import 'package:qgchat/widgets/avatar.dart';

class OnLine extends StatefulWidget {
  OnLine({Key key}) : super(key: key);

  @override
  _OnLineState createState() => _OnLineState();
}

class _OnLineState extends State<OnLine> with AutomaticKeepAliveClientMixin {
  @override
  bool get wantKeepAlive => true;
  
  var anchor = Container(
    height: px(180),
    margin: EdgeInsets.symmetric(horizontal: px(30)),
    decoration: BoxDecoration(
      border: Border(
        bottom: BorderSide(
          color: col("edeff2"),
          width: 1,
        ),
      ),
    ),
    child: Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: <Widget>[
        Expanded(
          child: Row(
            children: <Widget>[
              Avatar(
                "https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=2978782906,723865607&fm=26&gp=0.jpg",
                true,
              ),
              Container(
                margin: EdgeInsets.only(left: px(20)),
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: <Widget>[
                    Text(
                      "Antonio",
                      style: TextStyle(
                        color: col("303133"),
                        fontSize: px(28),
                      ),
                    ),
                    Container(
                      margin: EdgeInsets.only(top: px(20)),
                      child: Row(
                        children: <Widget>[
                          Container(
                            margin: EdgeInsets.only(right: px(10)),
                            child: Image.asset(
                              "assets/images/icon/star.png",
                              width: px(32),
                              height: px(32),
                            ),
                          ),
                          Text(
                            "5688",
                            style: TextStyle(
                              color: col("fea800"),
                              fontSize: px(28),
                            ),
                          ),
                        ],
                      ),
                    ),
                  ],
                ),
              )
            ],
          ),
        ),
        Container(
          width: px(120),
          height: px(60),
          child: OutlineButton(
            onPressed: () => {},
            borderSide: BorderSide(
              color: col("fea800"),
            ),
            shape: RoundedRectangleBorder(
              side: BorderSide.none,
              borderRadius: BorderRadius.all(Radius.circular(50)),
            ),
            child: Text(
              "私信",
              style: TextStyle(
                color: col("fea800"),
                fontSize: px(26),
              ),
            ),
          ),
        ),
      ],
    ),
  );

  @override
  Widget build(BuildContext context) {
    super.build(context);
    return ListView(
      children: <Widget>[
        anchor,
        anchor,
        anchor,
      ],
    );
  }
}
